const state = {
    historyNoticeList:JSON.parse(localStorage.getItem('historyNoticeList'))||[]
}
const mutations = {
    SET_HISORY_NOTICE_LIST(state,history){
        state.historyNoticeList=history
    },
    CLEAR_HISORY_NOTICE_LIST(state){
        state.historyNoticeList=[]
    }
}
const actions = {
    getNoticeHistory({commit,state},history){
        let list=state.historyNoticeList
        list.unshift(history)
        localStorage.setItem('historyNoticeList',JSON.stringify(list))
        commit('SET_HISORY_NOTICE_LIST',list)
    },
    clearNoticeHistory({commit,state}){
        localStorage.removeItem('historyNoticeList');
        commit('CLEAR_HISORY_NOTICE_LIST')
    }
}
export default {
  state,
  mutations,
  actions
}